package ml.practicum.feature;

import java.io.Serializable;
import java.util.List;

/**
 * Is a basic implementation of all the requirements in {@link Feature}.
 * @author jfs230
 * @version %I% %G%
 * @param <V>	the Class of input to describe for processing 
 */
public class BasicFeature<V extends Serializable> implements Feature<V>, Serializable {
		
	private static final long serialVersionUID = 5418113350991378652L;
	protected String label;
	protected FeatureRole role;
	protected int max;
	protected int min;
	protected int discreteSteps;
	protected FeatureDataType inputType;
	protected FeatureDataType processTo;
	protected List<V> mapping;
	
	/**
	 * Default constructor
	 */
	public BasicFeature(){
		this(null);
	}
	
	/**
	 * Constructor using the feature name to set the label
	 * @param label 	the feature name
	 */
	public BasicFeature(String label) {
		super();
		this.label = label;
	}
	
	public int getMin() {
		return min;
	}
	public void setMin(int min) {
		this.min = min;
	}

	public void setMapping(List<V> mapping) {
		this.mapping = mapping;
	}
	public int getDiscreteSteps() {
		return discreteSteps;
	}
	public void setDiscreteSteps(int discreteSteps) {
		this.discreteSteps = discreteSteps;
	}

	public String getLabel() {
		return label;
	}
	public void setLabel(String label) {
		this.label = label;
	}
	
	public FeatureRole getRole() {
		return role;
	}
	public void setRole(FeatureRole role) {
		this.role = role;
	}
	public FeatureDataType getInputType() {
		return inputType;
	}
	public void setInputType(FeatureDataType inputType) {
		this.inputType = inputType;
	}
	public FeatureDataType getProcessTo() {
		return processTo;
	}
	public void setProcessTo(FeatureDataType processTo) {
		this.processTo = processTo;
	}
	public int getMax() {
		return max;
	}
	public void setMax(int max) {
		this.max = max;
	}
	
	public String toString(){
		return String.format("{label=%s, role=%s, min%d, max=%d, input=%s output=%s, discreteSteps=%d mapping=%s}", label, role, min,max,inputType, processTo, discreteSteps, mapping );
	}
	
	public List<V> getMapping() {
		return this.mapping;
	}
}
